<div class="xsy_approval_bar_content">
    <!-- 待提交 -->
    {{if approvalStatus == 0}}
    <div class="xsy_approval_bar_status">
           <span class="xsy_approval_bar_yellowfont">待提交</span>
    </div>
    <!-- 撤回 -->
    {{else if approvalStatus == 4}}
    <div class="xsy_approval_bar_status">
            <span class="xsy_approval_bar_redfont">{{approvalTime}} {{'APPROVAL_BE_CANCEL' | i18n}}</span>
    </div>
    <!-- 审批中 -->
    {{else if approvalStatus == 1}}
        {{if isCounterSigner == "1"}}
            <div class="xsy_approval_bar_status">
                <span>{{'APPROVAL_WAIT' | i18n}}</span>
                {{each currentApprovalList as currentApproval i}}
                    <a href="/final/user.action?uid={{users[currentApproval.approvalUserId].id}}" target="_blank">{{users[currentApproval.approvalUserId].name}}</a>
                {{/each}}
                会签</span>
            </div>
        {{else}}
            {{if currentApproval != 0}}
                <div class="xsy_approval_bar_status">
                    <span>{{'APPROVAL_WAIT' | i18n}} <a href="/final/user.action?uid={{users[currentApproval].id}}" target="_blank">{{users[currentApproval].name}}</a> {{'APPROVAL' | i18n}}</span>
                </div>
            {{/if}}
        {{/if}}
     <!-- 审批通过 -->
    {{ else if approvalStatus == 3}}
        <div class="xsy_approval_bar_status">
            <span class="xsy_approval_bar_greenfont">
                {{approvalTime}} {{'APPROVAL_PASS' | i18n}}{{'APPROVAL' | i18n}}
            </span>
        </div>
    {{else if approvalStatus == 2}}
        {{if isCounterSigner == "1"}}
            <div class="xsy_approval_bar_status">
                <span>
                     <span class="xsy_approval_bar_redfont">{{approvalTime}} {{'APPROVAL_BE' | i18n}} </span>
                     {{each currentApprovalList as currentApproval i}}
                        <a href="/final/user.action?uid={{users[currentApproval.approvalUserId].id}}" target="_blank">{{users[currentApproval.approvalUserId].name}}</a>
                     {{/each}}
                     <span class="xsy_approval_bar_redfont">{{'APPROVAL_COUNTERSIGN_TOGETHER' | i18n}} {{'APPROVAL_REJECT' | i18n}}</span>
                </span>
                {{each currentApprovalList as currentApproval i}}
                    {{if currentApproval.result == "0"}}
                        <p class="reject" style="display:none;">
                            <span>{{users[currentApproval.approvalUserId].name}}</span>
                            <span class="xsy_approval_bar_redfont">{{'APPROVAL_REJECT_REASON' | i18n}}: </span>
                            <span>{{currentApproval.opinion}}</span>
                        </p>
                    {{/if}}
                {{/each}}
            </div>
        {{else}}
            {{if currentApproval != 0}}
                <div class="xsy_approval_bar_status">
                    <span class="xsy_approval_bar_redfont">{{approvalTime}} {{'APPROVAL_BE' | i18n}} </span><a href="/final/user.action?uid={{users[currentApproval].id}}" target="_blank">{{users[currentApproval].name}}</a><span class="xsy_approval_bar_redfont"> {{'APPROVAL_REJECT' | i18n}}</span>
                    <p class="reject" style="display:none;">
                        <span class="red-font" class="xsy_approval_bar_redfont">{{'APPROVAL_REJECT_REASON' | i18n}}: </span>
                        <span>{{opinion}}</span>
                    </p>
                </div>
            {{/if}}
        {{/if}}
    {{/if}}
    {{if allApprovals}}
    <div class="xsy_approval_bar_flow">
        <a href="javascript:;" class="xsy_approval_bar_check">{{ 'SCRPT_TMPL_APPROVAL_DETAIL_6' | i18n }}</a>
        <div class="xsy_approval_wrap" style="display:none;">
            <div class="xsy_approval_wrap_toparrow">
                <div class="xsy_approval_wrap_toparrow_inner"></div>
            </div>
            <div class="xsy_approval_process_list">
                <div class="xsy_approval_list_inner">
                    <ul class="xsy_approval_ul">
                        {{each allApprovals as approval i}}
                            <li>
                            {{if approval.signApprovals && approval.signApprovals.length > 0}}
                                <div class="xsy_submit_time">
                                    {{if approval.operateType == 6 || approval.operateType == 7}}
                                        <span class="xsy_passed_approval"></span>
                                    {{else if approval.operateType == 4 || approval.operateType == 5}}
                                        <span class="xsy_reject_approval"></span>
                                    {{else}}
                                        <span class="xsy_awaiting_approval"></span>
                                    {{/if}}
                                    <span class="xsy_passed_time">
                                        {{if approval.activityName}}
                                            <span class="xsy_passed_person">{{approval.activityName}}</span>
                                        {{/if}}
                                        {{if approval.operateType}}
                                            {{approval.signApprovals[approval.signApprovals.length - 1].approvalTime}}
                                        {{else}}
                                            {{'APPROVAL_RESULT_WAIT_2' | i18n}}
                                        {{/if}}
                                    </span>
                                </div>
                                <div class="xsy_submit_peopel_img">
                                    {{each approval.signApprovals as signApproval i}}
                                        <a target="_blank" href="/final/user.action?uid={{users[signApproval.approvalUserId].id}}">
                                            <img src="{{users[signApproval.approvalUserId].icon}}"/>
                                        </a>
                                    {{/each}}
                                </div>
                                <div class="xsy_submit_peopel">
                                    <span class="dblock approval_people_opinion">
                                        {{if approval.operateType}}
                                            <span class="dbline-block">{{approval.signApprovals.length}}{{'APPROVAL_PEOPLE_ONLY' | i18n}}{{'APPROVAL_COUNTERSIGN' | i18n}}</span>
                                            {{if approval.operateType == 6}}
                                                <span class="xsy_green_font"> {{'APPROVAL_AGREE' | i18n}}</span><span> {{'APPROVAL_THE_APPROVAL' | i18n}}</span>
                                            {{else if approval.operateType == 4}}
                                                <span class="xsy_red_font"> {{'APPROVAL_REJECT' | i18n}}</span><span> {{'APPROVAL_THE_APPROVAL' | i18n}}</span>
                                            {{else if approval.operateType == 5}}
                                                <span class="xsy_red_font"> {{'APPROVAL_BE' | i18n}}{{'APPROVAL_CANCEL' | i18n}}</span>
                                            {{else if approval.operateType == 7}}
                                                <span class="xsy_green_font"> {{'APPROVAL_OPERATE_PASS' | i18n}}</span>
                                            {{/if}}
                                        {{else}}
                                             <span class="dbline-block">{{approval.signApprovals.length}}{{'APPROVAL_PEOPLE_ONLY' | i18n}}{{'APPROVAL_SIGN' | i18n}}</span>
                                        {{/if}}
                                    </span>
                                    {{each approval.signApprovals as signApproval i}}
                                        <span class="dblock approval_people_opinion">
                                            <a href="/final/user.action?uid={{users[signApproval.approvalUserId].id}}" target="_blank" ucard="uid={{users[signApproval.approvalUserId].id}}">{{users[signApproval.approvalUserId].name}}:</a>
                                            {{if signApproval.result == 1}}
                                                <span class="xsy_green_font"> {{'APPROVAL_AGREE' | i18n}}</span>
                                                <span class="xsy_time rfloat">{{signApproval.approvalTime}}</span>
                                            {{else if signApproval.result == 0}}
                                                <span class="xsy_red_font"> {{'APPROVAL_REJECT' | i18n}}</span>
                                                <span class="xsy_time rfloat">{{signApproval.approvalTime}}</span>
                                            {{else if signApproval.result == -1}}
                                                <span class="xsy_yellow_font"> {{'APPROVAL_RESULT_WAIT_2' | i18n}}</span>
                                            {{else if signApproval.result == 5}}
                                                <span class="xsy_red_font"> {{'APPROVAL_BE' | i18n}}{{'APPROVAL_CANCEL' | i18n}}</span>
                                                <span class="xsy_time rfloat">{{signApproval.approvalTime}}</span>
                                            {{/if}}
                                        </span>
                                        {{if signApproval.opinion}}
                                            <div class="xsy_approval_people_wrap">
                                                <div class="xsy_approval_people_toparrow">
                                                    <div class="xsy_approval_people_toparrowinner"></div>
                                                </div>
                                            <div class="approval_people_content">{{signApproval.opinion}}</div>
                                            </div>
                                        {{/if}}
                                    {{/each}}
                                </div>
                            {{else if approval.result == -1}}
                            <div class="xsy_submit_time">
                                <span class="xsy_awaiting_approval"></span>
                                {{if approvalStatus == 4 || approvalStatus == 2}}
                                    <span class="xsy_passed_time">
                                    {{if approval.activityName}}
                                    <span class="xsy_passed_person">{{approval.activityName}}</span>
                                    {{/if}}
                                    待提交</span>
                                {{else}}
                                    <span class="xsy_passed_time">
                                    {{if approval.activityName}}
                                    <span class="xsy_passed_person">{{approval.activityName}}</span>
                                    {{/if}}
                                    {{'APPROVAL_RESULT_WAIT_2' | i18n}}</span>
                                {{/if}}
                            </div>
                            <div class="xsy_submit_peopel_img">
                                <a target="_blank" href="/final/user.action?uid={{users[approval.approvalUserId].id}}">
                                    <img src="{{users[approval.approvalUserId].icon}}"/>
                                </a>
                            </div>
                            <div class="xsy_submit_peopel">
                                <a href="/final/user.action?uid={{users[approval.approvalUserId].id}}" target="_blank" ucard="uid={{users[approval.approvalUserId].id}}">{{users[approval.approvalUserId].name}}</a>
                                {{if approvalStatus == 4 || approvalStatus == 2}}
                                    <span class="xsy_yellow-font">待提交</span>
                                {{else}}
                                    <span class="xsy_yellow-font">{{'APPROVAL_RESULT_WAIT_2' | i18n}}</span>
                                {{/if}}
                            </div>

                            {{else if approval.result == 3 && approval.operateType == 1}}
                                <div class="xsy_submit_time">
                                    <span class="xsy_passed_approval"></span>
                                    <span class="xsy_passed_time">
                                    <span class="xsy_passed_person">{{'SUBMIT' | i18n}}</span>
                                    {{approval.approvalTime}}</span>
                                </div>
                                <div class="xsy_submit_peopel_img"
                                    <a target="_blank" href="/final/user.action?uid={{users[approval.approvalUserId].id}}">
                                        <img src="{{users[approval.approvalUserId].icon}}"/>
                                    </a>
                                </div>
                                <div class="xsy_submit_peopel">
                                    <span class="dblock xsy_approval_people_opinion">
                                        <a href="/final/user.action?uid={{users[approval.approvalUserId].id}}" target="_blank" ucard="uid={{users[approval.approvalUserId].id}}">{{users[approval.approvalUserId].name}}</a>
                                        <span> {{'APPROVAL_OPERATE_SUBMIT' | i18n}}</span>
                                        {{if approval.opinion}}
                                            <div class="xsy_approval_people_wrap">
                                                <div class="xsy_approval_people_toparrow">
                                                    <div class="xsy_approval_people_toparrowinner"></div>
                                                </div>
                                                <div class="xsy_approval_people_content">{{approval.opinion}}</div>
                                            </div>
                                        {{/if}}
                                    </span>
                                </div>
                            {{else if approval.result == 1 && approval.operateType==6}}
                                <div class="xsy_submit_time">
                                    <span class="xsy_passed_approval"></span>
                                    <span class="xsy_passed_time">
                                    {{if approval.activityName}}
                                    <span class="xsy_passed_person">{{approval.activityName}}</span>
                                    {{/if}}
                                    {{approval.approvalTime}}</span>
                                </div>
                                <div class="xsy_submit_peopel_img">
                                    <a target="_blank" href="/final/user.action?uid={{users[approval.approvalUserId].id}}">
                                        <img src="{{users[approval.approvalUserId].icon}}"/>
                                    </a>
                                </div>
                                <div class="xsy_submit_peopel">
                                    <span class="dblock xsy_approval_people_opinion">
                                        <a href="/final/user.action?uid={{users[approval.approvalUserId].id}}" target="_blank" ucard="uid={{users[approval.approvalUserId].id}}">{{users[approval.approvalUserId].name}}</a>
                                        <span class="xsy_green_font"> {{'APPROVAL_AGREE' | i18n}}</span>
                                        <span>{{'APPROVAL_THE_APPROVAL' | i18n}}</span>
                                        {{if approval.opinion}}
                                            <div class="xsy_approval_people_wrap">
                                                <div class="xsy_approval_people_toparrow">
                                                    <div class="xsy_approval_people_toparrowinner"></div>
                                                </div>
                                                <div class="xsy_approval_people_content">{{approval.opinion}}</div>
                                            </div>
                                        {{/if}}
                                    </span>
                                </div>
                            {{else if approval.result == 1 && approval.operateType==7}}
                                <div class="xsy_submit_time">
                                    <span class="xsy_passed_approval"></span>
                                    <span class="xsy_passed_time">
                                    {{if approval.activityName}}
                                    <span class="xsy_passed_person">{{approval.activityName}}</span>
                                    {{/if}}
                                    {{approval.approvalTime}}</span>
                                </div>
                                <div class="xsy_submit_peopel_img">
                                    <a target="_blank" href="/final/user.action?uid={{users[approval.approvalUserId].id}}">
                                        <img src="{{users[approval.approvalUserId].icon}}"/>
                                    </a>
                                </div>
                                <div class="xsy_submit_peopel">
                                    <span class="dblock approval_people_opinion">
                                        <a href="/final/user.action?uid={{users[approval.approvalUserId].id}}" target="_blank" ucard="uid={{users[approval.approvalUserId].id}}">{{users[approval.approvalUserId].name}}</a>
                                        <span class="xsy_green_font"> {{'APPROVAL_OPERATE_PASS' | i18n}}</span>
                                        {{if approval.opinion}}
                                            <div class="xsy_approval_people_wrap">
                                                <div class="xsy_approval_people_toparrow">
                                                <div class="xsy_approval_people_toparrowinner"></div>
                                            </div>
                                            <div class="xsy_approval_people_content">{{approval.opinion}}</div>
                                            </div>
                                        {{/if}}
                                    </span>
                                </div>
                            {{else if approval.result == 3 && approval.operateType==3}}
                                <div class="xsy_submit_time">
                                    <span class="xsy_passed_approval"></span>
                                    <span class="xsy_passed_time">
                                    <span class="xsy_passed_person">{{'SUBMIT' | i18n}}</span>
                                    {{approval.approvalTime}}</span>
                                </div>
                                <div class="xsy_submit_peopel_img">
                                    <a target="_blank" href="/final/user.action?uid={{users[approval.approvalUserId].id}}">
                                        <img src="{{users[approval.approvalUserId].icon}}"/>
                                    </a>
                                </div>
                                <div class="xsy_submit_peopel">
                                    <a href="/final/user.action?uid={{users[approval.approvalUserId].id}}" target="_blank" ucard="uid={{users[approval.approvalUserId].id}}">{{users[approval.approvalUserId].name}}</a>
                                    <span> {{'APPROVAL_OPERATE_RESUBMIT' | i18n}}</span>
                                </div>

                            {{else if approval.operateType==5}}
                                <div class="xsy_submit_time">
                                    <span class="xsy_reject_approval"></span>
                                    <span class="xsy_passed_time">
                                    {{if approval.activityName}}
                                    <span class="xsy_passed_person">{{approval.activityName}}</span>
                                    {{/if}}
                                    {{approval.approvalTime}}</span>
                                </div>
                                <div class="xsy_submit_peopel_img">
                                    <a target="_blank" href="/final/user.action?uid={{users[approval.approvalUserId].id}}">
                                        <img src="{{users[approval.approvalUserId].icon}}"/>
                                    </a>
                                </div>
                                <div class="xsy_submit_peopel">
                                    <a href="/final/user.action?uid={{users[approval.approvalUserId].id}}" target="_blank" ucard="uid={{users[approval.approvalUserId].id}}">{{users[approval.approvalUserId].name}}</a>
                                    <span class="xsy_red_font"> {{'APPROVAL_OPERATE_CANCEL' | i18n}}</span>
                                </div>
                            {{else if approval.result == 0}}
                                <div class="xsy_submit_time">
                                    <span class="xsy_reject_approval"></span>
                                    <span class="xsy_passed_time">
                                    {{if approval.activityName}}
                                    <span class="xsy_passed_person">{{approval.activityName}}</span>
                                    {{/if}}
                                    {{approval.approvalTime}}</span>
                                </div>
                                <div class="xsy_submit_peopel_img">
                                    <a target="_blank" href="/final/user.action?uid={{users[approval.approvalUserId].id}}">
                                        <img src="{{users[approval.approvalUserId].icon}}"/>
                                    </a>
                                </div>
                                <div class="xsy_submit_peopel">
                                    <span class="dblock xsy_approval_people_opinion">
                                        <a href="/final/user.action?uid={{users[approval.approvalUserId].id}}" target="_blank" ucard="uid={{users[approval.approvalUserId].id}}">{{users[approval.approvalUserId].name}}</a>
                                        <span class="xsy_red_font"> {{'APPROVAL_REJECT' | i18n}}</span>
                                        {{if approval.opinion}}
                                            <div class="xsy_approval_people_wrap">
                                                <div class="xsy_approval_people_toparrow">
                                                    <div class="xsy_approval_people_toparrowinner"></div>
                                                </div>
                                                <div class="xsy_approval_people_content">{{approval.opinion}}</div>
                                            </div>
                                        {{/if}}
                                    </span>
                                </div>
                            {{/if}}
                            </li>
                        {{/each}}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    {{/if}}

    <div class="xsy_approval_bar_operate">
        {{if approvalStatus == 1 && currentApproval == currentUserId}}
            <a href="javascript:;" class="xsy_approval_bar_agree"> <i></i>
                同意
            </a>
            <a href="javascript:;" class="xsy_approval_bar_reject"> <i></i>
                拒绝
            </a>
        {{/if}}

        {{if canSubmitApproval}}
            <a href="javascript:;" class="xsy_approval_bar_submit"> <i></i>
                {{submitBtnName}}
            </a>
        {{/if}}
        {{if canCancelApproval}}
            <a href="javascript:;" class="xsy_approval_bar_recall"> <i></i>
                撤回{{submitBtnName}}
            </a>
        {{/if}}

        {{if approvalStatus == 1 && currentApproval == currentUserId}}
            <form action="/json/crm_approval/deal-approval.action" type="post">
            <input type="hidden" class="approvalResult" name="approvalResult" value="1" />
            <input name="commentSystemId" type="hidden" value="602"/>
            <input name="objectId" type="hidden" value="{{objectId}}"/>
            <input name="belongId" type="hidden" value="{{belongId}}"/>
            <input name="entityTypeId" type="hidden" value="{{entityTypeId}}"/>
            <input name="createdBy" type="hidden" value="{{createdBy}}"/>
            <input name="objectName" type="hidden" value="{{objectName}}"/>
            <input name="isParallelGateway" type="hidden" value="{{isParallelGateway}}"/>
            <input name="isCounterSigner" type="hidden" value="{{isCounterSigner}}"/>
            <input name="taskid" type="hidden" value="{{taskid}}"/>

            <div class="js_approval_tip xsy_approval_bar_tip" style="display:none;">
                <div class="xsy_approval_bar_tip_toparrow">
                    <div class="xsy_approval_bar_tip_topinside"></div>
                </div>
                <div class="xsy_approval_bar_tip_content">
                    <div class="xsy_approval_bar_tip_msg">
                        <textarea placeholder="请输入审批意见" name="commentContent"></textarea>
                    </div>

                    <div class="xsy_approval_bar_tip_detail">
                            <div class="xsy_approval_bar_tip_people">
                                {{if hasApprovers == true || allowSelectApprover == true || isParallelGateway == 1}}
                                    <span class="xsy_approval_bar_people_magin">转到</span>
                                    <input type="hidden" {{if defaultApprover}} value="{{defaultApprover.id}}" {{/if}} class="approvalUser_hidden" name="approval.approvalUserId"/>
                                    {{if isParallelGateway == 0}}
                                        <span class="xsy_approval_bar_people_select">
                                            <span>
                                                {{if defaultApprover}}
                                                    {{defaultApprover.name}}
                                                {{else}}
                                                    {{'APPROVAL_SELECT_PEOPLE' | i18n}}
                                                {{/if}}
                                            </span>
                                            <i></i>
                                        </span>
                                    {{else}}
                                        <span class="xsy_approval_bar_people_magin">{{'APPROVAL_MULTIPEOPLE_COUNTERSIGN' | i18n}}</span>
                                    {{/if}}
                                    <span class="xsy_approval_bar_people_magin">继续审批</span>
                                    <div class="xsy_approval_bar_selectmenu" style="display:none;">
                                        {{if approverList && approverList.length > 0}}
                                        <ul class="xsy_approval_bar_selectmenu_ul">
                                            {{each approverList as approver i}}
                                                <li class="xsy_approval_bar_selectmenu_itme">
                                                    <a href="javascript:;" id="{{approver.id}}">
                                                        <img class="userpic" ucard="uid={{approver.id}}" src="{{ if approver.smallIcon}}{{approver.smallIcon}}{{else}}/img/default_face.png{{/if}}"/>
                                                        {{approver.name}}
                                                    </a>
                                                    <!-- <p><span>{{approver.name}}</span></p> -->
                                                </li>
                                            {{/each}}
                                        </ul>
                                        {{/if}}
                                        {{if allowSelectApprover == true}}
                                            <div class="xsy_approval_bar_autocomplete">
                                                <span class="xsy_approval_bar_des">输入姓名选择其它审批人：</span>
                                                <div>
                                                    <input id="xsy_approval_user_select" type="text" class="text" placeholder="请输入并选择">
                                                    <a href="javascript:;" class="xsy_approval_bar_confirm">确定</a>
                                                </div>
                                            </div>
                                        {{/if}}
                                    </div>
                                {{/if}}
                            </div>
                        <div class="xsy_approval_bar_tip_operate">
                            <a href="javascript::" class="xsy_approval_bar_tip_agree js_submit" value="1">同 意</a>
                        </div>
                    </div>

                </div>
            </div>
            </form>
            <form action="/json/crm_approval/deal-approval.action" type="post">
            <input type="hidden" class="approvalResult" name="approvalResult" value="0" />
            <input name="commentSystemId" type="hidden" value="602"/>
            <input name="objectId" type="hidden" value="{{objectId}}"/>
            <input name="belongId" type="hidden" value="{{belongId}}"/>
            <input name="entityTypeId" type="hidden" value="{{entityTypeId}}"/>
            <input name="createdBy" type="hidden" value="{{createdBy}}"/>
            <input name="objectName" type="hidden" value="{{objectName}}"/>
            <input name="isParallelGateway" type="hidden" value="{{isParallelGateway}}"/>
            <input name="isCounterSigner" type="hidden" value="{{isCounterSigner}}"/>
            <input name="taskid" type="hidden" value="{{taskid}}"/>
            <div class="js_reject_tip xsy_approval_bar_tip xsy_approval_bar_rejecttip" style="display:none;">
                <div class="xsy_approval_bar_tip_toparrow">
                    <div class="xsy_approval_bar_tip_topinside"></div>
                </div>
                <div class="xsy_approval_bar_tip_content">
                    <div class="xsy_approval_bar_tip_msg">
                        <textarea placeholder="请输入审批意见" name="commentContent"></textarea>
                    </div>
                    <div class="xsy_approval_bar_tip_detail">
                        <div class="xsy_approval_bar_tip_people"></div>
                        <div class="xsy_approval_bar_tip_operate">
                            <a href="javascript::" class="xsy_approval_bar_tip_reject js_submit" value="0">拒 绝</a>
                        </div>
                    </div>
                </div>
            </div>
            </form>
        {{/if}}


    </div>

    {{if canRelieveApproval}}
        <a href="javascript:;" class="xsy_approval_bar_relieve"> <i></i>
         解除当前审批流程
        </a>
    {{/if}}
</div>